package com.ruisi.operateClasses;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

/*
 * SQLiteOpenHelper类用于操作SQLite数据库*/
public class DatabaseHelper extends SQLiteOpenHelper{
	
	private static final int VERSION=1;
	
	//构造函数
	public DatabaseHelper(Context context,String name,CursorFactory factory,int version){
		super(context,name,factory,version);
	}
	
	public DatabaseHelper(Context context,String name,int version){
		this(context,name,null,version);
	}
	
	public DatabaseHelper(Context context,String name){
		this(context,name,VERSION);
	}
	
	public void onCreate(SQLiteDatabase db){
		db.execSQL("create table user(id integer primary key,name text)");
	}
	
	public void onUpgrade(SQLiteDatabase arg0,int arg1,int arg2){
		System.out.println("更新数据库");
	}

}
